package com.graduation_design.modules.app.controller;

import com.graduation_design.common.lang.Result;
import com.graduation_design.modules.app.annotation.Login;
import com.graduation_design.service.AppUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/app")
public class UserController {

    @Resource
    AppUserService appUserService;

    /**
     * 登录完成之后获取用户信息
     */
    @Login
    @GetMapping("/userInfo")
    public Result userInfo() {
       return Result.success(appUserService.getCurrentUser());
    }

    /**
     * 没有限制
     */
    @GetMapping("/userInfo1")
    public Result userInfo1() {
        return Result.success();
    }
}
